package com.oocl.servlet.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.service.DishManager;
import com.oocl.service.factory.DishManagerFactory;

@WebServlet("/sec/dishes/delete.action")
public class DeleteDishActionServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	private DishManager dishManager = DishManagerFactory.getInstance();

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String dishId = request.getParameter("dId");
		dishManager.deleteDish(dishId);
		response.sendRedirect("list");
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
